package cn.edu.xmu.oomall.customer.mapper.jpa;

import cn.edu.xmu.oomall.customer.mapper.po.AddressPo;
import jdk.dynalink.Operation;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

/**
 * @author 谢传艳
 * @date 2024/12/18
 */
@Repository
public interface AddressPoMapper extends JpaRepository<AddressPo, Long> {
    Integer countByCustomerId(Long customerId);

    List<AddressPo> findAllByCustomerId(Long customerId);

    Optional<AddressPo> findByCustomerIdAndBeDefault(Long id, Byte Default);
}
